package com.bdqn.SJ.service;

import com.bdqn.SJ.dao.SupplierMapper;
import com.bdqn.SJ.pojo.Supplier;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service("supplierService")// 注册为一个Service层的Bean
public class SupplierServiceImpl implements SupplierService{

    @Resource// @Autowired // 使用注解的方式将DAO层的Bean注入
    private SupplierMapper supplierMapper;

    @Override
    public List<Supplier> getList(Supplier supplier) {
        try {
            return supplierMapper.selectSupplierList(supplier);
        }catch (RuntimeException e){
            e.printStackTrace();
            throw e;
        }
    }

    public void setSupplierMapper(SupplierMapper supplierMapper) {
        this.supplierMapper = supplierMapper;
    }
}
